<template>
  <div class="loading">
    <Transition name="load" mode="out-in">
      <div
        class="loading-back c_flex c_justify_center c_align_center"
        v-if="modalFlag"
      >
        <div class="img">
            <img src="../../assets/images/loading.png" alt="" />
        </div>
        
      </div>
    </Transition>
  </div>
</template>

<script>
export default {
  name: "loading-transition",
  props: {
    value: {
      type: Boolean,
      default: () => {
        return false;
      },
    },
  },
  computed: {
    modalFlag: {
      set(val) {
        this.$emit("input", val);
      },
      get() {
        return this.value;
      },
    },
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.loading {
  position: fixed;
  width: 100vw;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: 999999;
  .loading-back {
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #d17f03, #FFCC00, #CC0033);
    background-size: 500% 500%;
    animation: moiveAnimation 15s infinite;
    @keyframes moiveAnimation {
            0% {
                background-position: 0% 50%
            }
            50% {
                background-position: 100% 50%
            }
            100% {
                background-position: 0% 50%
            }
        }
    img {
        width: 64rem;
        height: 64rem;
        animation: rotate 0.5s linear infinite;
    }
    @keyframes rotate {
      from {
        transform: rotate(0deg);
      }
      to {
        transform: rotate(360deg);
      }
    }
  }
}
.load-enter-active,
.load-leave-active {
  transition: all 0.3s;
}
.load-enter,
.load-leave-to {
  opacity: 0;
}
</style>